
public class User {
	
	public String name;
	public double[] preferences = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
	public double listenCount;
	
	public User( String uName )
	{
		this.name = uName;
		this.listenCount = 0;
	}
	
	public void UpdatePreferences( int cluster, int count)
	{
		double impact = Math.exp( 1 + (-1.0 / count));
		
		double oldCount = listenCount;
		listenCount += impact;

		for (int i =0; i<10; i++)
		{
			preferences[i] *= ((double) oldCount) / listenCount;
			if ( i == cluster )
			{
				preferences[i] += ((double) impact) / listenCount;	
			}
		}
		
	}
}
